#lang sicp
;; 2.61
(define (adjoint-set element set)
  (cond ((null? set)
         (list element))
        ((> element (car set))
         (cons (car set)
               (adjoint-set element (cdr set))))
        ((< element (car set))
         (cons element set))
        ((= element (car set)) set)))
(define a (list 1 5 6 12))
;;2.62
(define (union-set set1 set2)
  (cond ((null? set1) set2)
        ((null? set2) set1)
        ((> (car set1) (car set2))
         (cons (car set2) (union-set set1 (cdr set2))))
        ((< (car set1) (car set2))
         (cons (car set1) (union-set (cdr set1) set2)))
        (else
         (cons (car set1) (union-set (cdr set1) (cdr set2))))))
(define b (list 1 3 4 11 ))